<template>
	<view class="wrap">
		<view class="top"></view>
		 
		<div v-for="item in list" :key="item.id" @click="han(item)">
			{{ item.title }}
		</div>
	</view>
</template>

<script setup lang="ts">
	import { $u, logger } from 'uview-pro';
	import { ref, computed,reactive ,nextTick } from 'vue';
	import { getUser } from '../../common/api';
	
	import { onLoad, onShow, onReady, onHide, onUnload } from '@dcloudio/uni-app'
	import { useUserStore } from '../../stores/modules/user';
	import { storeToRefs } from 'pinia'  
	import { ResType } from '../../types/res';
	// 手机号输入
	const tel = ref('');

     let list = ref([])


	const userStore = useUserStore()
	import { useRouter, useRoute } from 'uni-mini-router'
	const router = useRouter()
	const route = useRoute() // 当前路由对象（响应式）
	const han = (item)=>{
	router.push({ path: '/pages/index/login', query: { ...item} })
	
		console.log('sssssssssssssssssss');
	}
	
	
	console.log(route?.query?.id??0);
	
	onLoad((options) => {
		// userStore.loginout({})
	})
	onShow(() => {
		getUser(3, route.path).then(async (re:ResType )=>  {
			console.log(re);
			list.value = re?.data?.data??[]
			await nextTick()

		})

	})
	onReady(() => {



	})

	// userStore.login()
	//   console.log(userStore.token);
</script>

<style lang="scss" scoped>
	.wrap {
		font-size: 28rpx;

		.content {
			width: 600rpx;
			margin: 0 auto;

			.title {
				text-align: left;
				font-size: 60rpx;
				font-weight: 500;
				margin-bottom: 100rpx;
			}

			input {
				text-align: left;
				margin-bottom: 10rpx;
				padding-bottom: 6rpx;
			}

			.tips {
				color: $u-type-info;
				margin-bottom: 60rpx;
				margin-top: 8rpx;
			}

			.getCaptcha {
				background-color: rgb(253, 243, 208);
				color: $u-tips-color;
				border: none;
				font-size: 30rpx;
				padding: 12rpx 0;

				&::after {
					border: none;
				}
			}

			.alternative {
				color: $u-tips-color;
				display: flex;
				justify-content: space-between;
				margin-top: 30rpx;
			}
		}

		.loginBottom {
			.loginType {
				display: flex;
				padding: 350rpx 150rpx 150rpx 150rpx;
				justify-content: space-between;

				.item {
					display: flex;
					flex-direction: column;
					align-items: center;
					color: $u-content-color;
					font-size: 28rpx;
				}
			}

			.hint {
				padding: 20rpx 40rpx;
				font-size: 20rpx;
				color: $u-tips-color;

				.link {
					color: $u-type-warning;
				}
			}
		}
	}
</style>